introduction
The math function library contains a comprehensive set of mathematics functions,
including:
trigonometric
arc-trigonometric
hyperbolic
arc-hyperbolic
logarithmic ( base e and base 10 )
exponential ( base e and base 10 )
miscellaneous ( square root, power, etc. )
function names
The names of library functions usually begin with a three character prefix that identifies
the library - in this case it would be Xma .
In math intensive programs, this is visually annoying and unnatural. For this reason, the
math and complex number libraries violate the naming convention in favor of familiar
names. To take the sine of angle a# , therefore, write:
x# = SIN(a#) ' correct
x# = XmaSin(a#) ' wrong
arguments and return values
Except for POWER() , all math library functions take one DOUBLE argument and return a
DOUBLE result. POWER() takes two DOUBLE arguments and returns a DOUBLE result.
angles
Angles are always radians, for both arguments and return values.
To convert degrees to radians, multiply by $$DEGTORAD.
To convert radians to degrees, multiply by $$RADTODEG.
declarations
Your program must contain EXTERNAL FUNCTION statements
in the PROLOG for every math library function it calls. You can include all the function
declarations and constant definition of the math library with an IMPORT "xma" in your prolog as in:
IMPORT "xma" ' include math library declarations
IMPORT "xst" ' include standard library declarations